/**
 * Copyright (c) 2015 www.smarthome.com All rights reserved. <br />
 * 本软件源代码版权归xxxx公司,未经许可不得任意复制与传播.<br />
 *
 */
package com.smarthome.core.deviceManager.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.smarthome.base.service.ShEquipmentDevSwingService;
import com.smarthome.core.deviceManager.EquipmentDevSwingService;
import com.smarthome.domain.bean.ShEquipmentDevSwing;
import com.smarthome.domain.vo.boss.DataGrid;
import com.smarthome.domain.vo.boss.PageHelper;

@Service("equipmentDevSwingService")
public class EquipmentDevSwingServiceImpl implements EquipmentDevSwingService {

	@Resource
	private ShEquipmentDevSwingService shEquipmentDevSwingService;

	@Override
	public DataGrid dataGrid(ShEquipmentDevSwing devSwing, PageHelper page) {
		return shEquipmentDevSwingService.queryDataGrid(devSwing, page);
	}

	@Override
	public void saveOrUpdate(ShEquipmentDevSwing devSwing) {
		shEquipmentDevSwingService.saveOrUpdate(devSwing);
	}

	@Override
	public ShEquipmentDevSwing queryById(Long id) {
		ShEquipmentDevSwing swing = new ShEquipmentDevSwing();
		swing.setId(id);
		shEquipmentDevSwingService.selectEntryList(swing);
		List<ShEquipmentDevSwing> swings = shEquipmentDevSwingService
				.selectList(swing);
		if (swings != null && swings.size() > 0) {
			return swings.get(0);
		}
		return null;
	}

	@Override
	public int delete(Long id) {
		return shEquipmentDevSwingService.deleteByIds(id);
	}

	@Override
	public List<ShEquipmentDevSwing> getAllList(ShEquipmentDevSwing swing) {
		return shEquipmentDevSwingService.selectEntryList(swing);
	}
}
